#pragma once

#include <QWidget>
#include "ui_page4.h"
#include "MyData.h"
#include "SportMeeting.h"
#include <QTableWidget>
#include <QTableWidgetItem>
#include <algorithm>
class SportMeeting;
class page4 : public QWidget
{
	Q_OBJECT

public:
	page4(QWidget *parent = nullptr);
	~page4();
	friend void setPage(SportMeeting* sportMeeting, QWidget*);
	void setData(MyData*);
	void loadData();
	void initRowlabels();
	void initColumnlabels();
	void exchange(QString m, QString n);
	void updatalabels();
	void initTable();
	QVector<QVector<int>> matrix;
	vector<int> reallyRow;
	vector<int> reallyColumn;

private:
	Ui::page4Class ui;
	MyData* myData;
	SportMeeting* parent;
	QStringList rowlabels;
	QStringList columnlabels;
	QVector<boyItem> boyItems;
	QVector<girlItem> girlItems;
	QVector<team> teams;
private slots:
	void pre_page();
	void next_page();
	void typeBox();
	void waysBox();
	void sort();
	void check();
};
